using System;
using System.ComponentModel.DataAnnotations;
using HengTong.Model.Interfaces;
using TiaoTaoHelper.Wtm.Interfaces;
using TiaoTaoHelper.Wtm.Models;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model;

/// <summary>
/// 基础单据类，所有单据的基类
/// 提供单据的基本字段和流程管理功能
/// </summary>
public class BaseBill : BasePoco, IBill, IDataPrivilegeEntity
{
    /// <summary>
    /// 获取或设置审批人
    /// </summary>
    /// <value>流程审批人姓名</value>
    [Display(Name = "审批人", Description = "流程审批人", GroupName = "流程信息")]
    [StringLength(64)]
    public string Approver { get; set; }

    /// <summary>
    /// 获取或设置审批时间
    /// </summary>
    /// <value>流程审批的具体时间</value>
    [Display(Name = "审批时间", Description = "流程审批时间", GroupName = "流程信息")]
    public DateTime? ApprovalTime { get; set; }
    
    /// <summary>
    /// 获取或设置所属部门导航属性
    /// </summary>
    /// <value>关联的部门实体</value>
    [Display(Name = "所属部门", Description = "关联的部门", GroupName = "工作信息")]
    public SysGroup Group { get; set; }

    /// <summary>
    /// 获取或设置所属部门ID
    /// </summary>
    /// <value>关联的部门ID</value>
    [Display(Name = "所属部门ID", Description = "关联的部门ID", GroupName = "工作信息")]
    public Guid? GroupId { get; set; }

    /// <summary>
    /// 获取或设置所属机构导航属性
    /// </summary>
    /// <value>关联的机构实体</value>
    [Display(Name = "所属机构", Description = "关联的机构", GroupName = "工作信息")]
    public SysOrg Org { get; set; }
    
    /// <summary>
    /// 获取或设置所属机构ID
    /// </summary>
    /// <value>关联的机构ID</value>
    [Display(Name = "所属机构ID", Description = "关联的机构ID", GroupName = "工作信息")]
    public Guid? OrgId { get; set; }

    /// <summary>
    /// 获取或设置单据编号
    /// </summary>
    /// <value>单据的唯一编号</value>
    [Required(ErrorMessage = "单据编号不能为空")]
    [Display(Name = "单据编号", Description = "单据的唯一编号", GroupName = "单据信息")]
    [StringLength(128)]
    public string BillCode { get; set; }
    
    /// <summary>
    /// 获取或设置单据状态
    /// </summary>
    /// <value>单据的处理状态</value>
    [Display(Name = "单据状态", Description = "单据的处理状态", GroupName = "单据信息")]
    public BillStatus? BillStatus { get; set; }

    /// <summary>
    /// 获取或设置工作流状态
    /// </summary>
    /// <value>工作流的执行状态</value>
    [Display(Name = "工作流状态", Description = "工作流的执行状态", GroupName = "单据信息")]
    public WorkflowStatus? WorkflowStatus { get; set; }

    /// <summary>
    /// 获取或设置备注
    /// </summary>
    /// <value>单据的备注信息</value>
    [Display(Name = "备注", Description = "单据的备注信息", GroupName = "单据信息")]
    [StringLength(512)]
    public string Remark { get; set; }
}